package com.xf;

public class ArithmeticImpl implements Arithmetic {
    @Override
    public Double add(Double a, Double b) {
        return a+b;
    }

    @Override
    public Double sub(Double a, Double b) {
        return a-b;
    }

    @Override
    public Double div(Double a, Double b) {
        if(b==0){
            System.out.println("不能除以0！");
            return 0.0;
        }
        return a/b;
    }

    @Override
    public Double mul(Double a, Double b) {
        return a*b;
    }
}
